package ch07_GUI编程;

import javax.swing.ImageIcon;

public class ImageFactory {
	private static final String ROOT = "images/";
	//以下类方法出现了未知错误，暂时不明白；
//	private static final ClassLoader LOADER = ImageFactory.class.getClassLoader();
//	public static ImageIcon create(String file) {
//		return new ImageIcon (LOADER.getResource(ROOT+file));
//	}
	public static ImageIcon create(String file) {
		return new ImageIcon (ROOT+file);
	}

}
